#ifndef _RADIAN_LAYER_H_
#define _RADIAN_LAYER_H_

#include "RadianCommon.h"

/* Radian layer.
  RadianLayer is the base class of all the layers of the game.
*/
class RadianLayer
{
	friend RadianLayerController;

public:
	RadianLayer(const Ogre::String& layerName);
	virtual ~RadianLayer();

	/* Init layer data.
	*/
	virtual void InitLayerData();

	/* Update layer from the controller.
	*/
	virtual void Update(float timeSinceLastFrame) = 0;

	/* Draw the layer.
	*/
	virtual void Draw() = 0;

	/* Set attribuites.
	*/
	void SetWidth(float width);
	void SetHeight(float height);
	void SetIndex(int index);
	void SetScrollU(float scrollU);
	void SetScrollV(float scrollV);
	void SetTileX(float tileX);
	void SetTileY(float tileY);
	void SetTexture(const Ogre::String& textureName);
	void SetVisible(bool visible);

	/* Get attribuites.
	*/
	inline const Ogre::String& GetTexture(void) const { return mTextureName;}
	inline float GetWdith() const { return mWidth;}
	inline float GetHeigh() const { return mHeight;}
	inline float GetScaleX() const { return mScaleX;}
	inline float GetScaleY() const { return mScaleY;}
	inline float GetScrollU() const { return mScrollU;}
	inline float GetScrollV() const { return mScrollV;}
	inline float GetTileX() const { return mTileX;}
	inline float GetTileY() const { return mTileY;}
	inline bool GetVisible() const { return mVisible;}
	inline int GetIndex() const { return mIndex;}


protected:
	Ogre::String mLayerName;					// the name of the layer
	Ogre::String mTextureName;					// texture name

	int mIndex;								// the index of the layer
	float mWidth;								// layer width
	float mHeight;								// layer heigh
	
	float mScaleX;								// scale on the y
	float mScaleY;								// scale on the x


	float mScrollU;								// u scroll speed
	float mScrollV;								// v scroll spped

	unsigned int mTileX;						// tile on the x
	unsigned int mTileY;						// tile on the y

	Ogre::TextureUnitState* mLayerTU;			// texture unitstate		
	RadianLayerController* mLayerController;	// layer controller
	bool mVisible;								// layer visible
};
#endif